<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <label> <input type="file" hidden> 上传</label>

    <img width="100">
    <script>
        const oInput = document.querySelector('input');
        const oImg = document.querySelector('img')
        oInput.onchange = fileChange;

        function fileChange(e) {
            const file = e.target.files[0];
            if (!file) {
                return
            }
            console.log(file);
            const temp64 = window.URL.createObjectURL(file);
            oImg.src = temp64;
            const fd = new FormData();
            fd.append('image', fd);
            // await sendRequet(fd)

        }
    </script>
</body>

</html>